
#ifndef _IALIGNITEM_H_
#define _IALIGNITEM_H_

#include <BPainter>
#include <BFont>
#include <BIcon>
#include <BImage>
#include <BTextFormat>
#include <BScrollBar>
#include <BTreeItem>
#include <BTreeWidget>
#include "ITextBlock.h"
#include "IAlignment.h"
#include "IRound.h"

namespace BWE
{
	class IAlignItem : public IAlignment
	{
	public:
		IAlignItem(BObject* object);
		IAlignItem(const IAlignItem& other);
		~IAlignItem();

		virtual void dispenseStyles(const BStyle* style);
		virtual void translateText(const BStyle* style);

		void setPos(int x, int y);
		void setPos(const BPoint& pos);

		void setWidth(int width);
		void setHeight(int height);
		void setSize(int width, int height);
		void setSize(const BSize& size);

		BRect rect() const;

		virtual void applyStyle(const BStyle* style);
		virtual void freshSize(const BFont* font, int width);
		virtual void freshRects();
		void adjustWidget();

		void drawBackground(BPainter& painter, State state) const;
		void drawMargin(BPainter& painter, State state) const;
		void drawBorder(BPainter& painter, State state) const;
		void drawContent(BPainter& painter, State state) const;

		BObject*			object;
		Align				align;
		Form				form;
		int					spacing;
		BString				text;
		BColor				color;
		Graph				graph;
		BImageHolder		image;
		BIconHolder			icon;
		BWidgetHolder		widget;
		BSize				iconSize;
		float				lineWidth;
		bool				lineFeed;
		BString				tips;

		bool				dirtyStyle;
		bool				translatable;
		BHolder<BStyle>		realStyle;
		BColor				background;
		BColor				foreground;

		bool				dirty;
		BPoint				pos;
		BSize				size;
		BSize				shellSize;
		BSize				baseSize;
		BSize				minSize;
		BSize				maxSize;
		int					border;
		BMargin				margin;
		BHolder<IRound>		round;
		ITextBlock			block;
		BSize				hintSize;
		BRectf				rectTop;
		BRectf				rectRight;
		BRectf				rectLeft;
		BRectf				rectBottom;
		BRectf				rectLeftTop;
		BRectf				rectLeftBottom;
		BRectf				rectRightTop;
		BRectf				rectRightBottom;
		BRectf				rectCenter;

	};
}
#endif